package com.cqu.lpss.service.impl;

import com.cqu.lpss.mapper.AdministorsMapper;
import com.cqu.lpss.pojo.Administors;
import com.cqu.lpss.service.AdministorsInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdministorsImpl implements AdministorsInterface {
    @Autowired
    AdministorsMapper administorsMapper;
    @Override
    public Administors login(Administors administor) {
        Administors ans = administorsMapper.findByIdAndPassword(administor.getAdmId(),administor.getAdmPassword());
        return ans;
    }

    @Override
    public Administors findById(String admId) {
        Administors administors = administorsMapper.findById(admId);
        return  administors;
    }

    @Override
    public Administors findByPhone(String phone) {
        Administors administors = administorsMapper.findByPhone(phone);
        return  administors;
    }

    @Override
    public int PersonCenter_upload(String newpassword,String phone,String email, String Id) {
        int ans = administorsMapper.PersonCenter_upload(newpassword, phone, email, Id);
        return ans;

    }
}
